<include file="Public/head"/>
<body class="no-skin">
<include file="Public/header"/>
<div class="main-container" id="main-container">
    <script type="text/javascript">
        try {
            ace.settings.check('main-container', 'fixed');
        } catch (e) {
        }
    </script>

    <include file="Public/sidebar"/>
    <div class="main-content">
        <div class="main-content-inner">
            <!-- #section:basics/content.breadcrumbs -->
            <include file="Public/breadcrumbs"/>

            <!-- /section:basics/content.breadcrumbs -->
            <div class="page-content">
                <include file="Public/set"/>

                <!-- /section:settings.box -->
                <div class="row">
                    <div class="col-xs-12">
                        <!-- PAGE CONTENT BEGINS -->
                        <div class="row">
                            <iframe name="goods_execl_file" style="display:none;"></iframe>
                            <style>
                            .execl_goods_a{display:inline-block; width:100px; height:40px; background:red; position:relative; overflow:hidden;}
                            .goods_execl_file{position:absolute; right:0; top:0; font-size:100px; opacity:0; filter:alpha(opacity=0);}
                            </style>
                          
                            <form class="form-inline" action="{:U('index')}" style=" padding: 0px 5px; float:left" method="get">

                                <label class="inline">商品搜索</label>
                                <input type="text" name="keyword" value="{$sh.keyword}" class="form-control">
                                <input type="hidden" name="c" value="{$Think.const.CONTROLLER_NAME}" class="form-control">
                                <input type="hidden" name="a" value="{$Think.const.ACTION_NAME}" class="form-control">
                                <input type="hidden" name="m" value="{$Think.const.MODULE_NAME}" class="form-control">
                                <div class="form-group">
                                    <select name="rsp">
                                        <option value="">请选择状态</option>
                                    <volist name="rspList" id="vvv">
                                        <option value="{$vvv.rsp}" <if condition="$vvv.rsp eq I('get.rsp')">selected="selected" </if>>{$vvv.rsp}</option>
                                    </volist>                                    
                                </select>
                                </div>
                                <div class="form-group">
                                    <select name="poname">
                                        <option value="">请选择操作类型</option>
                                    <volist name="POnameList" id="vvv">
                                        <option value="{$vvv.op}" <if condition="$vvv.op eq I('get.op')">selected="selected" </if>>{$vvv.op}</option>
                                    </volist>                                    
                                </select>
                                </div>
                                <div class="form-group">
                                    <select name="site_id">
                                        <option value="">请选择站点</option>
                                    <volist name="site_idList" id="vvv">
                                        <option value="{$vvv.site_id}" <if condition="$vvv.site_id eq I('get.site_id')">selected="selected" </if>>{$vvv.site_id}</option>
                                    </volist>                                    
                                </select>
                                </div>
                                <div class="form-group">
                                    <select name="store_id">
                                        <option value="">请选择店铺</option>
                                    <volist name="store_idList" id="vvv">
                                        <option value="{$vvv.store_id}" <if condition="$vvv.store_id eq I('get.store_id')">selected="selected" </if>>{$vvv.store_id}</option>
                                    </volist>                                    
                                </select>
                                </div>
                                
                                <button type="submit" class="btn btn-purple btn-sm">
                                    <span class="ace-icon fa fa-search icon-on-right bigger-110"></span>
                                    Search
                                </button>
                            </form>
                        </div>
                      
                        <div class="space-4"></div>
                        <style>
                            .goodslist{font-size: 10px;}
                        </style>
                        <div class="row">
                            <form id="form" method="post" action="{:U('retry')}">
                                <table class="table table-striped table-bordered table-hover goodslist" >
                                    <thead>
                                    <tr>
                                        <th class="center"><input class="check-all" type="checkbox" value=""></th>
                                        <th width="100px">商品ID</th>
                                        <th width="100px">货号ID</th>
                                        <th width="260px">站点ID</th>
                                        <th>商店ID</th>
                                        <th width="90px">操作类别</th>
                                        <th>操作员ID</th>
                                        <th>操作时间</th>
                                        <th>状态</th>
                                        <th>返回结果</th>

                                        <th class="center" width="50px" >操作</th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    <style>
                                        .grouptd {
                                            position: relative;
                                        }

                                        .group {
                                            display: inline-block;
                                            width: 100%;
                                        }

                                        .groupselect {
                                            position: absolute;
                                            top: 0;
                                            left: 0;
                                            width: 100%;
                                            height: 100%;
                                            border: 0;
                                        }
                                    </style>
                                    <volist name="list" id="val">
                                        <tr>
                                            <td class="center">
                                               <input class="ids" type="checkbox" name="ids[]" value="{$val['id']}">
                                            </td>
                                            <td>{$val['goods_id']}</td>
                                            <td>{$val['sku']}</td>
                                            <td>{$val['site_id']}</td>
                                            <td>{$val['store_id']}</td>
                                            <td>{$val['op']}</td>
                                            <td>{$val['uid']}</td>
                                            <td>{$val['optime']|date="Y-m-d H:i:s",###}</td>
                                            <td>{$val['rsp']}</td>
                                            <td>{$val['log']}</td>
                                            <td class="center"><a href="{:U('retry',array('ids'=>$val['id']))}">重试</a>&nbsp;
                                               <a class="del" href="javascript:;"
                                                                                     val="{:U('del',array('id'=>$val['id']))}"
                                                                                     title="删除">删除</a>
                                            </td>
                                        </tr>
                                    </volist>
                                    
                                    </tbody>
                                </table>
                              
                            <div class="cf">

                                <button  class="btn btn-info" type="submit" value="重试">重试</button>
                            </div>
                            </form>
                            {$page}
                        </div>
                        <!-- PAGE CONTENT ENDS -->
                    </div><!-- /.col -->
                </div><!-- /.row -->
            </div><!-- /.page-content -->
        </div>
    </div><!-- /.main-content -->
    <include file="Public/footer"/>

</div><!-- /.main-container -->

<include file="Public/footerjs"/>
<!-- inline scripts related to this page -->
<script type="text/javascript">
    $(function () {
        var goods_type_id = $('#goods_type').val();
        if(goods_type_id){
            $('#goods_type_id option').each(function(){
                  if( goods_type_id == $(this).attr('value') ) {
                      $(this).attr('selected' , true);
                      return false;
                  } 
               }); 
        }
         
      


        $(".check-all").click(function () {
            $(".ids").prop("checked", this.checked);
        });
        $(".ids").click(function () {
            var option = $(".ids");
            option.each(function (i) {
                if (!this.checked) {
                    $(".check-all").prop("checked", false);
                    return false;
                } else {
                    $(".check-all").prop("checked", true);
                }
            });
        });
       
        
        $(".del").click(function () {
            var url = $(this).attr('val');
            bootbox.confirm({
                title: "系统提示",
                message: "是否要删除该?",
                callback: function (result) {
                    if (result) {
                        window.location.href = url;
                    }
                },
                buttons: {
                    "cancel": {"label": "取消"},
                    "confirm": {
                        "label": "确定",
                        "className": "btn-danger"
                    }
                }
            });
        });
    })
</script>
</body>
</html>
